package com.sanley.piss.mapper;


import com.sanley.piss.model.BaseMapper;
import com.sanley.piss.model.po.Organization;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

/**
 * @author limk
 * @date 2021/1/26 8:30
 */
@Mapper
public interface OrganizationMapper extends BaseMapper<Organization> {
    /**
     * 根据组织名字查询组织ID
     * @param name
     * @return
     */
    int selectDeptIdbyOrgName(String name);

    /**
     * 批量修改
     * @param list
     * @return
     */
    int updateBatch(List<Organization> list);

    /**
     * 批量插入
     * @param list
     * @return
     */
    int batchInsert(List<Organization> list);

    /**
     * 查询ID 组织名字
     * @return
     */
    @Select("select org_name from t_system_organization")
    Set<String> selectOrgIdAndName();
}